#ifndef __LINUX_NODEMASK_H
#define __LINUX_NODEMASK_H

#include <linux/types.h>
#include <linux/numa.h>

typedef struct { DECLARE_BITMAP(bits, MAX_NUMNODES); } nodemask_t;

enum node_states {
	N_POSSIBLE,		/* The node could become online at some point */
	N_ONLINE,		/* The node is online */
	N_NORMAL_MEMORY,	/* The node has regular memory */
#ifdef CONFIG_HIGHMEM
	N_HIGH_MEMORY,		/* The node has regular or high memory */
#else
	N_HIGH_MEMORY = N_NORMAL_MEMORY,
#endif
	N_CPU,		/* The node has one or more cpus */
	NR_NODE_STATES
};

#define for_each_node_state(node, __state) \
	for ( (node) = 0; (node) == 0; (node) = 1)

static inline int node_state(int node, enum node_states state)
{
	return node == 0;
}

#define node_online(node)	node_state((node), N_ONLINE)

#define for_each_node(node)	   for_each_node_state(node, N_POSSIBLE)
#define for_each_online_node(node) for_each_node_state(node, N_ONLINE)

#endif
